#设计实现 程序员鼓励师
import random

from pynput import keyboard
from playsound import playsound

soundlist=['sound/1.mp3','sound/2.mp3','sound/3.mp3']

count =0

def onrelease(key):

    print(key)
    global count
    count += 1
    if count % 10 == 0:
       i = random.randint (0,len(soundlist)-1)
       playsound('soundlist[i]')



listener = keyboard.Listener(on_release= onrelease)
listener.start()
listener.join()


